cssstyle: Move function from vfunc to static func
authorBenjamin Otte <otte@redhat.com>
Wed, 17 Dec 2014 12:30:51 +0000 (13:30 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 7 Jan 2015 13:26:47 +0000 (14:26 +0100)
compute_dependencies() is only used internally by GtkCssStaticStyle,
so there's no need to have it elsewhere.

gtk/gtkcssanimatedstyle.c
gtk/gtkcssstaticstyle.c
gtk/gtkcssstyle.c
gtk/gtkcssstyleprivate.h

index a86621be52378baf3b47782aefd075c68bca6209..98aa930865e9497a383acc35ed76c292d18fc235 100644 (file)
@@ -63,16 +63,6 @@ gtk_css_animated_style_get_section (GtkCssStyle *style,
   return gtk_css_style_get_section (animated->style, id);
 }
 
-static GtkBitmask *
-gtk_css_animated_style_compute_dependencies (GtkCssStyle      *style,
-                                             const GtkBitmask *parent_changes)
-{
-  GtkCssAnimatedStyle *animated = GTK_CSS_ANIMATED_STYLE (style);
-
-  /* XXX: This misses dependencies due to animations */
-  return gtk_css_style_compute_dependencies (animated->style, parent_changes);
-}
-
 static void
 gtk_css_animated_style_dispose (GObject *object)
 {
@@ -111,7 +101,6 @@ gtk_css_animated_style_class_init (GtkCssAnimatedStyleClass *klass)
 
   style_class->get_value = gtk_css_animated_style_get_value;
   style_class->get_section = gtk_css_animated_style_get_section;
-  style_class->compute_dependencies = gtk_css_animated_style_compute_dependencies;
 }
 
 static void
index d34deb02c6f31ff53cf1bc0fd9862925726b63db..d849953f9bdcee88adf6574c7f4700f2ce32a15b 100644 (file)
@@ -65,9 +65,14 @@ gtk_css_static_style_get_section (GtkCssStyle *style,
   return g_ptr_array_index (sstyle->sections, id);
 }
 
+/* Compute the bitmask of potentially changed properties if the parent has changed
+ * the passed in ones.
+ * This is for example needed when changes in the "color" property will affect
+ * all properties using "currentColor" as a color.
+ */
 static GtkBitmask *
-gtk_css_static_style_compute_dependencies (GtkCssStyle      *style,
-                                             const GtkBitmask *parent_changes)
+gtk_css_static_style_compute_dependencies (GtkCssStaticStyle *style,
+                                           const GtkBitmask  *parent_changes)
 {
   GtkCssStaticStyle *sstyle = GTK_CSS_STATIC_STYLE (style);
   GtkBitmask *changes;
@@ -125,7 +130,6 @@ gtk_css_static_style_class_init (GtkCssStaticStyleClass *klass)
 
   style_class->get_value = gtk_css_static_style_get_value;
   style_class->get_section = gtk_css_static_style_get_section;
-  style_class->compute_dependencies = gtk_css_static_style_compute_dependencies;
 }
 
 static void
@@ -225,7 +229,7 @@ gtk_css_static_style_new_update (GtkCssStaticStyle       *style,
   gtk_internal_return_val_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider), NULL);
   gtk_internal_return_val_if_fail (matcher != NULL, NULL);
 
-  changes = gtk_css_style_compute_dependencies (GTK_CSS_STYLE (style), parent_changes);
+  changes = gtk_css_static_style_compute_dependencies (style, parent_changes);
   if (_gtk_bitmask_is_empty (changes))
     {
       _gtk_bitmask_free (changes);
index f24557c65f2c87aa63f3fc5a3148dc019f70e9dc..040998b6cb7eefb83b267d21d28a75c16bce40cd 100644 (file)
@@ -46,18 +46,10 @@ gtk_css_style_real_get_section (GtkCssStyle *style,
   return NULL;
 }
 
-static GtkBitmask *
-gtk_css_style_real_compute_dependencies (GtkCssStyle      *style,
-                                         const GtkBitmask *parent_changes)
-{
-  return _gtk_bitmask_copy (parent_changes);
-}
-
 static void
 gtk_css_style_class_init (GtkCssStyleClass *klass)
 {
   klass->get_section = gtk_css_style_real_get_section;
-  klass->compute_dependencies = gtk_css_style_real_compute_dependencies;
 }
 
 static void
@@ -102,15 +94,6 @@ gtk_css_style_get_difference (GtkCssStyle *style,
   return result;
 }
 
-GtkBitmask *
-gtk_css_style_compute_dependencies (GtkCssStyle      *style,
-                                    const GtkBitmask *parent_changes)
-{
-  gtk_internal_return_val_if_fail (GTK_IS_CSS_STYLE (style), _gtk_bitmask_new ());
-
-  return GTK_CSS_STYLE_GET_CLASS (style)->compute_dependencies (style, parent_changes);
-}
-
 void
 gtk_css_style_print (GtkCssStyle *style,
                      GString     *string)
index d61b4c3cf90caf8e2ad55897c8271b5702184d3a..ad5b596b6ff18d6951f26d70a1f70f7df7b1a307 100644 (file)
@@ -54,13 +54,6 @@ struct _GtkCssStyleClass
    * Optional: default impl will just return NULL */
   GtkCssSection *       (* get_section)                         (GtkCssStyle            *style,
                                                                  guint                   id);
-  /* Compute the bitmask of potentially changed properties if the parent has changed
-   * the passed in ones.
-   * This is for example needed when changes in the "color" property will affect
-   * all properties using "currentColor" as a color.
-   * Optional: The default impl just returns the parent changes unchanged */
-  GtkBitmask *          (* compute_dependencies)                (GtkCssStyle            *style,
-                                                                 const GtkBitmask       *parent_changes);
 };
 
 GType                   gtk_css_style_get_type                  (void) G_GNUC_CONST;
@@ -71,8 +64,6 @@ GtkCssSection *         gtk_css_style_get_section               (GtkCssStyle
                                                                  guint                   id);
 GtkBitmask *            gtk_css_style_get_difference            (GtkCssStyle            *style,
                                                                  GtkCssStyle            *other);
-GtkBitmask *            gtk_css_style_compute_dependencies      (GtkCssStyle            *style,
-                                                                 const GtkBitmask       *parent_changes);
 
 char *                  gtk_css_style_to_string                 (GtkCssStyle            *style);
 void                    gtk_css_style_print                     (GtkCssStyle            *style,